package gp;


import java.util.List;

import firing.FiringTree;


public class TruncationSelection implements SelectionStrategy, IndexSelectionStrategy {
    
    public int getIndex(int populationSize) {
	return (int)(3 + 2* Math.random() * populationSize / 5 );
    }
    public String toString() {
	return "Truncation";
    }
    
    public List<FiringTree> getNextGen(List<FiringTree> prevGen) {
	return Generationator.getNextGen(prevGen, this);
    }
}
